package Demo_zhuanshu.XueQiang01;

import java.util.Collections;
import java.util.HashSet;

public class XueQiang01 {
    public static void main(String[] args) {
        HashSet<String> set = new HashSet<>();
        set.add("apple");
        set.add("grape");
        set.add("banana");
        set.add("pear");
        String max = Collections.max(set);
        System.out.println(max);
        System.out.println("*****************************");
        String min = Collections.min(set);
        System.out.println(min);
        System.out.println("*****************************");
        for (String o :set){
            System.out.println(o);
        }
    }
}
